package com.bicntech.system.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.bicntech.common.utils.ObjectUtil;
import com.bicntech.system.dto.InfieldBasicDataDTO;
import com.bicntech.system.entity.InfieldBasicData;
import com.bicntech.system.service.InfieldBasicDataService;
import com.bicntech.system.mapper.InfieldBasicDataMapper;
import org.springframework.stereotype.Service;

import java.util.List;

/**
* @author casc1
* @description 针对表【infield_basic_data(内场检查项基础数据)】的数据库操作Service实现
* @createDate 2024-03-03 12:53:22
*/
@Service
public class InfieldBasicDataServiceImpl extends ServiceImpl<InfieldBasicDataMapper, InfieldBasicData>
    implements InfieldBasicDataService{


    @Override
    public List<InfieldBasicDataDTO> listInfieldBasicData() {
        List<InfieldBasicData> infieldBasicData = lambdaQuery().eq(InfieldBasicData::getEnable,true)
                .orderByAsc(InfieldBasicData::getType).list();
        return ObjectUtil.deepCopyList(infieldBasicData,InfieldBasicDataDTO.class);
    }

    @Override
    public InfieldBasicDataDTO getInfieldBasicDataById(Long id) {
        return ObjectUtil.entityToModel(super.getById(id),InfieldBasicDataDTO.class);
    }

    @Override
    public List<InfieldBasicData> getIsSpecialVehicle() {
        return lambdaQuery().eq(InfieldBasicData::getIsSpecialVehicle,Boolean.TRUE).list();
    }
}




